#include <iostream>
#include <string>

using namespace std;

int main()
{
	string str, del;
	string out;
	getline(cin, str);   //接受一行字符串
	getline(cin, del);
	string::iterator pos = str.begin();
	while (pos != str.end()){
		int flag = 1;
		for (auto i : del){
			if (i == *pos){
                flag--;
			}
		}
		  if(flag){
		      out.push_back(*pos);
		  }
		if (pos != str.end()){
			++pos;
		}
    }
    /*
        while (pos != str.end()){
		for (auto i : del){
			if (i == *pos){
				if (pos == str.end() - 1){
					str.pop_back();
					break;
				}
				pos = str.erase(pos);
			}
		}
		if (pos != str.end()){
			++pos;
		}
	}
    cout << str << endl;
    */
     
	cout << out << endl;
	
}

